import { createStore } from "vuex"
import moduleA from "./module/moduleA";
import moduleB from "./module/moduleB";
const store = createStore({
    modules: {
        a:moduleA,
        b:moduleB,
    },
    state() {
        return {
            count: 100000
        }
    },
    getters: {
        tenTimes: (state) => {
            return state.count * 1000000000
        }
    },
    mutations:{
        incrementMut(state,playload){
            state.count = playload.count
        }
    },
    actions:{
        incrementAct(context,playload) {
            setTimeout(() => {
                context.commit('incrementMut',playload)
            },3000)
        }
    }
})
export default store